<!--
 * @Description: 
 * @Version: 1.0
 * @Autor: younghxp
 * @Date: 2022-03-18 14:49:57
 * @LastEditors: younghxp
 * @LastEditTime: 2022-03-23 18:16:53
-->
<template>
  <div class="container">
    <div>
      <topTitle
        titleText="历史记录"
        :back="true"
        @gobackTriser="goBack"
      ></topTitle>
    </div>
    <component v-bind:is="currentComponent" :showHistory="false"></component>
  </div>
</template>

<script>
import companySalaryBatchList from './companySalaryBatchList.vue'
import salaryPayBatchList from './salaryPayBatchList'
export default {
  name: 'companySalaryBatchListPage',
  components: {
    companySalaryBatchList,
    salaryPayBatchList,
  },
  data() {
    return {
      currentComponent,
    }
  },
  created() {
    if (
      this.$route.query.backPath ===
      '/home/monitorProjectManagement/projectDetail'
    ) {
      this.currentComponent = salaryPayBatchList
    } else {
      this.currentComponent = companySalaryBatchList
    }
  },
  methods: {
    goBack() {
      const { oldUrl, backPath, projectId } = this.$route.query
      this.$router.push({
        path: backPath,
        query: {
          projectId,
        },
      })
      this.$store.commit('GOBACK_NAME', {
        oldUrl,
        newUrl: this.$router.currentRoute.fullPath,
      })
    },
  },
}
</script>

<style></style>
